package com.example.android_practice

import android.content.Intent
import android.view.View
import com.example.android_practice.lifeCycle.MyService
import com.yaoyanshe.trialfield.common.base.BaseActivity

class MainActivity : BaseActivity(), View.OnClickListener {
    override fun getLayoutId(): Int {
        return R.layout.activity_main
    }


    override fun onClick(v: View) {
        when (v.id) {
            R.id.btn_viewmodel -> {
                val intent= Intent(this,LifeCycleActivity::class.java)
                startActivity(intent)
            }
            R.id.btn_startService->{
                val intent= Intent(this,MyService::class.java)
                startService(intent)
            }

            R.id.btn_stopService->{
                val intent= Intent(this,MyService::class.java)
                stopService(intent)
            }

        }
    }




}